<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class GoodsSku extends Model
{
    //
    protected $fillable = [
        'price',
        'name',
        'goods_id',
        'seller_id',
        'thumb',
        'stock',
        'sale_num',
        'status'
    ];
    protected $casts = [
        'status'=>'boolean'
    ];
    public function setPriceAttribute($value){
        $this->attributes['price'] = $value*100;
    }
    public function getPriceAttribute($value){
        return $value/100;
    }
}
